home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / developer-tools / andere sprachen / perl5 / perl5.002 / makefile < prev    next >
Encoding:
Makefile  |  1996-03-26  |  11.2 KB  |  373 lines

  1. # Makefile.SH
  2. # This file is derived from Makefile.SH.  Any changes made here will
  3. # be lost the next time you run Configure.
  4. #  Makefile is used to generate GNUmakefile.  The only difference
  5. #  is that GNUmakefile has the dependencies filled in at the end.
  6. #
  7. #
  8. # I now supply perly.c with the kits, so don't remake perly.c without byacc
  9. BYACC = byacc
  10. CC = gcc
  11. LD = ld
  12.  
  13. LDFLAGS = -s
  14. CLDFLAGS = -s
  15.  
  16. SMALL = 
  17. LARGE =  
  18. mallocsrc = 
  19. mallocobj = 
  20. LNS = /bin/ln -s
  21. RMS = rm -f
  22. ranlib = :
  23.  
  24. # The following are mentioned only to make metaconfig include the
  25. # appropriate questions in Configure.  If you want to change these,
  26. # edit config.sh instead, or specify --man1dir=/wherever on
  27. # installman commandline.
  28. bin = /gnu/bin
  29. scriptdir = /gnu/bin
  30. privlib = /gnu/lib/perl5
  31. man1dir =  
  32. man1ext = 0
  33. man3dir =  
  34. man3ext = 0
  35.  
  36. # The following are used to build and install shared libraries for
  37. # dynamic loading.
  38. LDDLFLAGS = 
  39. CCDLFLAGS = 
  40. DLSUFFIX = .none
  41. PLDLFLAGS = 
  42. PLIBSUF = .a
  43. SHRPENV = 
  44.  
  45. dynamic_ext =  
  46. static_ext =   lib/auto/Fcntl/Fcntl.a lib/auto/FileHandle/FileHandle.a lib/auto/Safe/Safe.a lib/auto/GDBM_File/GDBM_File.a lib/auto/SDBM_File/SDBM_File.a
  47. ext = $(dynamic_ext) $(static_ext)
  48. static_ext_autoinit =  
  49. DYNALOADER = lib/auto/DynaLoader/DynaLoader.a
  50.  
  51.  
  52. libs = -lnet -lgdbm -lsdbm -lm -lc 
  53.  
  54. public = perl  utilities translators
  55.  
  56. shellflags = 
  57.  
  58. ## To use an alternate make, set $altmake in config.sh.
  59. MAKE = make
  60.  
  61. # These variables will be used in a future version to make
  62. # the make file more portable to non-unix systems.
  63. AR = ar
  64. EXE_EXT = 
  65. LIB_EXT = .a
  66. OBJ_EXT = .o
  67. PATH_SEP = :
  68.  
  69. FIRSTMAKEFILE = GNUmakefile
  70.  
  71. # Any special object files needed by this architecture, e.g. os2/os2.obj
  72. ARCHOBJS = 
  73.  
  74.  
  75. CCCMD = `sh $(shellflags) cflags $(perllib) $@`
  76.  
  77. private = preplibrary lib/ExtUtils/Miniperl.pm lib/Config.pm
  78.  
  79. # Files to be built with variable substitution before miniperl
  80. # is available.
  81. sh = Makefile.SH cflags.SH config_h.SH makeaperl.SH makedepend.SH \
  82.     makedir.SH perl_exp.SH writemain.SH
  83.  
  84. shextract = Makefile cflags config.h makeaperl makedepend \
  85.     makedir perl_exp writemain
  86.  
  87. # Files to be built with variable substitution after miniperl is
  88. # available.  Dependencies handled manually below (for now).
  89.  
  90. pl = pod/pod2html.PL pod/pod2latex.PL pod/pod2man.PL pod/pod2text.PL
  91.  
  92. plextract = pod/pod2html pod/pod2latex pod/pod2man pod/pod2text
  93.  
  94. addedbyconf = UU $(shextract) $(plextract) pstruct
  95.  
  96. h1 = EXTERN.h INTERN.h XSUB.h av.h config.h cop.h cv.h dosish.h
  97. h2 = embed.h form.h gv.h handy.h hv.h keywords.h mg.h op.h
  98. h3 = opcode.h patchlevel.h perl.h perly.h pp.h proto.h regcomp.h
  99. h4 = regexp.h scope.h sv.h unixish.h util.h
  100. h = $(h1) $(h2) $(h3) $(h4)
  101.  
  102. c1 = $(mallocsrc) av.c scope.c op.c doop.c doio.c dump.c hv.c mg.c
  103. c2 = perl.c perly.c pp.c pp_hot.c pp_ctl.c pp_sys.c regcomp.c regexec.c
  104. c3 = gv.c sv.c taint.c toke.c util.c deb.c run.c globals.c
  105.  
  106. c = $(c1) $(c2) $(c3) miniperlmain.c perlmain.c
  107.  
  108. obj1 = $(mallocobj) gv.o toke.o perly.o op.o regcomp.o dump.o util.o mg.o
  109. obj2 = hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o
  110. obj3 = doop.o doio.o regexec.o taint.o deb.o globals.o
  111.  
  112.  
  113. obj = $(obj1) $(obj2) $(obj3) $(ARCHOBJS)
  114.  
  115. # Once perl has been Configure'd and built ok you build different
  116. # perl variants (Debugging, Embedded, Multiplicity etc) by saying:
  117. #    make clean; make perllib=libperl<type>.a
  118. # where <type> is some combination of 'd' and(or) 'e' or 'm'.
  119. # See cflags to understand how this works.
  120. #
  121. # Eventually some form of 'make-a-perl' script will automate this
  122. # together with linking a perl executable with any desired
  123. # static modules.
  124. perllib = libperl$(PLIBSUF)
  125.  
  126. lintflags = -hbvxac
  127.  
  128. # grrr
  129. SHELL = /bin/sh
  130.  
  131. .c.o:
  132.     $(CCCMD) $(PLDLFLAGS) $*.c
  133.  
  134. all: GNUmakefile miniperl $(private) $(plextract) $(public) $(dynamic_ext)
  135.     @echo " "; echo "    Everything is up to date."
  136.  
  137. translators:    miniperl lib/Config.pm FORCE
  138.     @echo " "; echo "    Making x2p stuff"; cd x2p; $(MAKE) all
  139.  
  140. utilities:    miniperl lib/Config.pm FORCE
  141.     @echo " "; echo "    Making utilities"; cd utils; $(MAKE) all
  142.  
  143.  
  144. # This is now done by installman only if you actually want the man pages.
  145. #    @echo " "; echo "    Making docs"; cd pod; $(MAKE) all;
  146.  
  147. # Phony target to force checking subdirectories.
  148. # Apparently some makes require an action for the FORCE target.
  149. FORCE:
  150.     @sh -c true
  151.  
  152. # The $& notation tells Sequent machines that it can do a parallel make,
  153. # and is harmless otherwise.
  154. # The miniperl -w -MExporter line is a basic cheap test to catch errors
  155. # before make goes on to run preplibrary and then MakeMaker on extensions.
  156. # This is very handy because later errors are often caused by miniperl
  157. # build problems but that's not obvious to the novice.
  158. # The Module used here must not depend on Config or any extensions.
  159.  
  160. miniperl: $& miniperlmain.o $(perllib)
  161.     $(CC) $(LARGE) $(CLDFLAGS) -o miniperl miniperlmain.o $(perllib) $(libs)
  162.     @./miniperl -w -Ilib -MExporter -e 0 || $(MAKE) minitest
  163.  
  164. miniperlmain.o: miniperlmain.c
  165.     $(CCCMD) $(PLDLFLAGS) $*.c
  166.  
  167. perlmain.c: miniperlmain.c config.sh GNUmakefile $(static_ext_autoinit)
  168.     sh writemain $(DYNALOADER) $(static_ext) > tmp
  169.     sh mv-if-diff tmp perlmain.c
  170.  
  171. perlmain.o: perlmain.c
  172.     $(CCCMD) $(PLDLFLAGS) $*.c
  173.  
  174. # The file ext.libs is a list of libraries that must be linked in
  175. # for static extensions, e.g. -lm -lgdbm, etc.  The individual
  176. # static extension Makefile's add to it.
  177. ext.libs: $(static_ext)
  178.     -@test -f ext.libs || touch ext.libs
  179.  
  180. perl: $& perlmain.o $(perllib) $(DYNALOADER) $(static_ext) ext.libs
  181.     $(SHRPENV) $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o perl perlmain.o $(perllib) $(DYNALOADER) $(static_ext) `cat ext.libs` $(libs)
  182.  
  183. pureperl: $& perlmain.o $(perllib) $(DYNALOADER) $(static_ext) ext.libs
  184.     purify $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o pureperl perlmain.o $(perllib) $(DYNALOADER) $(static_ext) `cat ext.libs` $(libs)
  185.  
  186. quantperl: $& perlmain.o $(perllib) $(DYNALOADER) $(static_ext) ext.libs
  187.     quantify $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o quantperl perlmain.o $(perllib) $(DYNALOADER) $(static_ext) `cat ext.libs` $(libs)
  188.  
  189. $(perllib): $& perl.o $(obj)
  190.     rm -f $(perllib)
  191.     $(AR) rcu $(perllib) perl.o $(obj)
  192.     @$(ranlib) $(perllib)
  193.  
  194. # This version, if specified in Configure, does ONLY those scripts which need
  195. # set-id emulation.  Suidperl must be setuid root.  It contains the "taint"
  196. # checks as well as the special code to validate that the script in question
  197. # has been invoked correctly.
  198.  
  199. suidperl: $& sperl.o perlmain.o $(perllib) $(DYNALOADER) $(static_ext) ext.libs
  200.     $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o suidperl perlmain.o sperl.o $(perllib) $(DYNALOADER) $(static_ext) `cat ext.libs` $(libs)
  201.  
  202. sperl.o: perl.c perly.h patchlevel.h $(h)
  203.     $(RMS) sperl.c
  204.     $(LNS) perl.c sperl.c
  205.     $(CCCMD) -DIAMSUID sperl.c
  206.     $(RMS) sperl.c
  207.  
  208. # We have to call our ./makedir because Ultrix 4.3 make can't handle the line
  209. #    test -d lib/auto || mkdir lib/auto
  210. #
  211. preplibrary: miniperl lib/Config.pm $(plextract)
  212.     @./makedir lib/auto
  213.     @echo "    AutoSplitting perl library"
  214.     @./miniperl -Ilib -e 'use AutoSplit; \
  215.         autosplit_lib_modules(@ARGV)' lib/*.pm lib/*/*.pm
  216.  
  217. # Take care to avoid modifying lib/Config.pm without reason
  218. lib/Config.pm: config.sh miniperl
  219.     ./miniperl configpm tmp
  220.     sh mv-if-diff tmp lib/Config.pm
  221.  
  222. lib/ExtUtils/Miniperl.pm: miniperlmain.c miniperl minimod.pl lib/Config.pm
  223.     ./miniperl minimod.pl > tmp && mv tmp $@
  224.  
  225. $(plextract):    miniperl lib/Config.pm
  226.     ./miniperl -Ilib $@.PL
  227.  
  228. install: all install.perl install.man
  229.  
  230. install.perl:    all
  231.     ./perl installperl
  232.  
  233. install.man:    all
  234.     ./perl installman
  235.  
  236. # Not implemented yet.
  237. #install.html:    all
  238. #    ./perl installhtml
  239.  
  240. # I now supply perly.c with the kits, so the following section is
  241. # used only if you force byacc to run by saying
  242. #     make run_byacc
  243. # Since we patch up the byacc output, the perly.fixer script needs
  244. # to run with precisely the same version of byacc as I use.  You
  245. # normally shouldn't remake perly.[ch].
  246.  
  247. run_byacc:    FORCE
  248.     @ echo 'Expect' 130 shift/reduce and 1 reduce/reduce conflict
  249.     $(BYACC) -d perly.y
  250.     sh $(shellflags) ./perly.fixer y.tab.c perly.c
  251.     mv y.tab.h perly.h
  252.     echo 'extern YYSTYPE yylval;' >>perly.h
  253.     - perl vms/vms_yfix.pl perly.c perly.h vms/perly_c.vms vms/perly_h.vms
  254.  
  255. # We don't want to regenerate perly.c and perly.h, but they might
  256. # appear out-of-date after a patch is applied or a new distribution is
  257. # made.
  258. perly.c: perly.y
  259.     -@touch perly.c
  260.  
  261. perly.h: perly.y
  262.     -@touch perly.h
  263.  
  264. # The following three header files are generated automatically
  265. #    keywords.h:    keywords.pl
  266. #    opcode.h:    opcode.pl
  267. #    embed.h:      embed.pl global.sym interp.sym
  268. # The correct versions should be already supplied with the perl kit,
  269. # in case you don't have perl available.
  270. # To force them to run, type
  271. #    make regen_headers
  272. regen_headers:    FORCE
  273.     perl keywords.pl
  274.     perl opcode.pl
  275.     perl embed.pl
  276.  
  277. # Extensions:
  278. # Names added to $(dynamic_ext) or $(static_ext) will automatically
  279. # get built.  There should ordinarily be no need to change any of
  280. # this part of GNUmakefile.
  281. #
  282. # The dummy dependency is a place holder in case $(dynamic_ext) or
  283. # $(static_ext) is empty.
  284. #
  285. # DynaLoader may be needed for extensions that use Makefile.PL.
  286.  
  287. $(DYNALOADER):    miniperl preplibrary FORCE
  288.     @sh ext/util/make_ext static $@ LIBPERL_A=$(perllib)
  289.  
  290. d_dummy $(dynamic_ext):    miniperl preplibrary $(DYNALOADER) FORCE
  291.     @sh ext/util/make_ext dynamic $@ LIBPERL_A=$(perllib)
  292.  
  293. s_dummy $(static_ext):    miniperl preplibrary $(DYNALOADER) FORCE
  294.     @sh ext/util/make_ext static $@ LIBPERL_A=$(perllib)
  295.  
  296. clean:
  297.     rm -f *.o *.a all perlmain.c
  298.     rm -f perl.exp ext.libs
  299.     -cd pod; $(MAKE) clean
  300.     -cd utils; $(MAKE) clean
  301.     -cd x2p; $(MAKE) clean
  302.     -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) ; do \
  303.     sh ext/util/make_ext clean $$x ; \
  304.     done
  305.     rm -f perl suidperl miniperl $(perllib)
  306.  
  307. realclean: clean
  308.     -cd os2; rm -f Makefile
  309.     -cd pod; $(MAKE) realclean
  310.     -cd utils; $(MAKE) realclean
  311.     -cd x2p; $(MAKE) realclean
  312.     -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) ; do \
  313.     sh ext/util/make_ext realclean $$x ; \
  314.     done
  315.     rm -f *.orig */*.orig *~ */*~ core t/core t/c t/perl
  316.     rm -rf $(addedbyconf)
  317.     rm -f GNUmakefile GNUmakefile.old
  318.     rm -f $(private)
  319.     rm -rf lib/auto
  320.     rm -f lib/.exists
  321.     rm -f h2ph.man pstruct
  322.     rm -rf .config
  323.     @echo "Note that make realclean does not delete config.sh"
  324.  
  325. clobber:    realclean
  326.     rm -f config.sh cppstdin
  327.  
  328. distclean:    clobber
  329.  
  330. # The following lint has practically everything turned on.  Unfortunately,
  331. # you have to wade through a lot of mumbo jumbo that can't be suppressed.
  332. # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
  333. # for that spot.
  334.  
  335. lint: perly.c $(c)
  336.     lint $(lintflags) $(defs) perly.c $(c) > perl.fuzz
  337.  
  338. GNUmakefile:    Makefile
  339.     $(MAKE) depend
  340.  
  341. config.h: config.sh
  342.     /bin/sh config_h.SH
  343.  
  344. # When done, touch perlmain.c so that it doesn't get remade each time.
  345. depend: makedepend
  346.     ./makedepend
  347.     - test -s perlmain.c && touch perlmain.c
  348.     cd x2p; $(MAKE) depend
  349.  
  350. test: miniperl perl preplibrary $(dynamic_ext)
  351.     - cd t && chmod +x TEST */*.t
  352.     - cd t && (rm -f perl; $(LNS) ../perl perl) && ./perl TEST </dev/tty
  353.  
  354. minitest: miniperl
  355.     - cd t && chmod +x TEST */*.t
  356.     - cd t && (rm -f perl; $(LNS) ../miniperl perl) \
  357.         && ./perl TEST base/*.t comp/*.t cmd/*.t io/*.t op/*.t </dev/tty
  358.  
  359. clist:    $(c)
  360.     echo $(c) | tr ' ' '\012' >.clist
  361.  
  362. hlist:  $(h)
  363.     echo $(h) | tr ' ' '\012' >.hlist
  364.  
  365. shlist: $(sh)
  366.     echo $(sh) | tr ' ' '\012' >.shlist
  367.  
  368. pllist: $(pl)
  369.     echo $(pl) | tr ' ' '\012' >.pllist
  370.  
  371. # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
  372. # If this runs make out of memory, delete /usr/include lines.
  373.